package com.wn.class30.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * myorder
 * @author 
 */
public class Myorder implements Serializable {
    /**
     * 订单主键
     */
    private Integer myorderId;

    /**
     * 订单编号
     */
    private String myorderNumber;

    /**
     * 用户ID
     */
    private Integer userId;

    /**
     * 订单状态 0待付款1待发货 2待收货 3待评价 4取消订单 5交易完成
     */
    private Integer myorderStatus;

    /**
     * 下单时间
     */
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date myorderTime;

    /**
     * 订单总价
     */
    private Double myorderTotalPrice;

    /**
     * 总订单id
     */
    private Integer allorderId;

    /**
     * 商家id
     */
    private Integer bussinessId;

    /**
     * 物流编号
     */
    private String wuliuNumber;

    /**
     * 物流公司
     */
    private String wuliuGongshi;

    /**
     * 发货时间
     */
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date myorderWuliuTime;

    private List<MyorderDetail> myorderDetails;
    private User user;
    private UserAddress userAddress;
    private Allorder allorder;

    public List<MyorderDetail> getMyorderDetails() {
        return myorderDetails;
    }

    public void setMyorderDetails(List<MyorderDetail> myorderDetails) {
        this.myorderDetails = myorderDetails;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public UserAddress getUserAddress() {
        return userAddress;
    }

    public void setUserAddress(UserAddress userAddress) {
        this.userAddress = userAddress;
    }

    public Allorder getAllorder() {
        return allorder;
    }

    public void setAllorder(Allorder allorder) {
        this.allorder = allorder;
    }

    public Business getBusiness() {
        return business;
    }

    public void setBusiness(Business business) {
        this.business = business;
    }

    private Business business;
    private static final long serialVersionUID = 1L;

    public Integer getMyorderId() {
        return myorderId;
    }

    public void setMyorderId(Integer myorderId) {
        this.myorderId = myorderId;
    }

    public String getMyorderNumber() {
        return myorderNumber;
    }

    public void setMyorderNumber(String myorderNumber) {
        this.myorderNumber = myorderNumber;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getMyorderStatus() {
        return myorderStatus;
    }

    public void setMyorderStatus(Integer myorderStatus) {
        this.myorderStatus = myorderStatus;
    }

    public Date getMyorderTime() {
        return myorderTime;
    }

    public void setMyorderTime(Date myorderTime) {
        this.myorderTime = myorderTime;
    }

    public Double getMyorderTotalPrice() {
        return myorderTotalPrice;
    }

    public void setMyorderTotalPrice(Double myorderTotalPrice) {
        this.myorderTotalPrice = myorderTotalPrice;
    }

    public Integer getAllorderId() {
        return allorderId;
    }

    public void setAllorderId(Integer allorderId) {
        this.allorderId = allorderId;
    }

    public Integer getBussinessId() {
        return bussinessId;
    }

    public void setBussinessId(Integer bussinessId) {
        this.bussinessId = bussinessId;
    }

    public String getWuliuNumber() {
        return wuliuNumber;
    }

    public void setWuliuNumber(String wuliuNumber) {
        this.wuliuNumber = wuliuNumber;
    }

    public String getWuliuGongshi() {
        return wuliuGongshi;
    }

    public void setWuliuGongshi(String wuliuGongshi) {
        this.wuliuGongshi = wuliuGongshi;
    }

    public Date getMyorderWuliuTime() {
        return myorderWuliuTime;
    }

    public void setMyorderWuliuTime(Date myorderWuliuTime) {
        this.myorderWuliuTime = myorderWuliuTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Myorder other = (Myorder) that;
        return (this.getMyorderId() == null ? other.getMyorderId() == null : this.getMyorderId().equals(other.getMyorderId()))
            && (this.getMyorderNumber() == null ? other.getMyorderNumber() == null : this.getMyorderNumber().equals(other.getMyorderNumber()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getMyorderStatus() == null ? other.getMyorderStatus() == null : this.getMyorderStatus().equals(other.getMyorderStatus()))
            && (this.getMyorderTime() == null ? other.getMyorderTime() == null : this.getMyorderTime().equals(other.getMyorderTime()))
            && (this.getMyorderTotalPrice() == null ? other.getMyorderTotalPrice() == null : this.getMyorderTotalPrice().equals(other.getMyorderTotalPrice()))
            && (this.getAllorderId() == null ? other.getAllorderId() == null : this.getAllorderId().equals(other.getAllorderId()))
            && (this.getBussinessId() == null ? other.getBussinessId() == null : this.getBussinessId().equals(other.getBussinessId()))
            && (this.getWuliuNumber() == null ? other.getWuliuNumber() == null : this.getWuliuNumber().equals(other.getWuliuNumber()))
            && (this.getWuliuGongshi() == null ? other.getWuliuGongshi() == null : this.getWuliuGongshi().equals(other.getWuliuGongshi()))
            && (this.getMyorderWuliuTime() == null ? other.getMyorderWuliuTime() == null : this.getMyorderWuliuTime().equals(other.getMyorderWuliuTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMyorderId() == null) ? 0 : getMyorderId().hashCode());
        result = prime * result + ((getMyorderNumber() == null) ? 0 : getMyorderNumber().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getMyorderStatus() == null) ? 0 : getMyorderStatus().hashCode());
        result = prime * result + ((getMyorderTime() == null) ? 0 : getMyorderTime().hashCode());
        result = prime * result + ((getMyorderTotalPrice() == null) ? 0 : getMyorderTotalPrice().hashCode());
        result = prime * result + ((getAllorderId() == null) ? 0 : getAllorderId().hashCode());
        result = prime * result + ((getBussinessId() == null) ? 0 : getBussinessId().hashCode());
        result = prime * result + ((getWuliuNumber() == null) ? 0 : getWuliuNumber().hashCode());
        result = prime * result + ((getWuliuGongshi() == null) ? 0 : getWuliuGongshi().hashCode());
        result = prime * result + ((getMyorderWuliuTime() == null) ? 0 : getMyorderWuliuTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", myorderId=").append(myorderId);
        sb.append(", myorderNumber=").append(myorderNumber);
        sb.append(", userId=").append(userId);
        sb.append(", myorderStatus=").append(myorderStatus);
        sb.append(", myorderTime=").append(myorderTime);
        sb.append(", myorderTotalPrice=").append(myorderTotalPrice);
        sb.append(", allorderId=").append(allorderId);
        sb.append(", bussinessId=").append(bussinessId);
        sb.append(", wuliuNumber=").append(wuliuNumber);
        sb.append(", wuliuGongshi=").append(wuliuGongshi);
        sb.append(", myorderWuliuTime=").append(myorderWuliuTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}